﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using PlugNT.Cms.Model;
using PlugNT.Cms.BLL;
using PlugNT.Cms.Page;

namespace PlugNT.Cms.Web.Admin.Pre_Enterprise
{
    public partial class Delete : AdminPage
    {
        private Enterprise curEnterprise = new Enterprise();

        protected void Page_Load(object sender, EventArgs e)
        {
            //权限检测
            this.CheckPower();

            if (!IsPostBack)
            {
                string type = (Request.QueryString["t"] == null) ? "" : Request.QueryString["t"].Trim();
                string id = (Request.QueryString["id"] == null) ? "" : Request.QueryString["id"].Trim();
                if (type == "delete" && id != "")
                {
                    int tid = int.Parse(id);
                    Delete_link(tid);
                }
            }
        }

        //删除一条数据
        void Delete_link(int id)
        {
            curEnterprise.Delete(id);
            Response.Redirect("Admin.aspx");
        }
    }
}
